Skip to content

Fix test test_SigningKey_from_pem_pkcs8v2_EdDSA with new Python#371

Merged
tomato42 merged 1 commit into
tlsfuzzer:masterfrom
shadchin:patch-1
Jun 5, 2026
Merged

Fix test test_SigningKey_from_pem_pkcs8v2_EdDSA with new Python#371
tomato42 merged 1 commit into
tlsfuzzer:masterfrom
shadchin:patch-1

Conversation

@shadchin
Copy link
Copy Markdown
Contributor

@shadchin shadchin commented Apr 9, 2026

Test test_SigningKey_from_pem_pkcs8v2_EdDSA fail with Python 3.13.13 or 3.14.4

pem from tests - https://github.com/tlsfuzzer/python-ecdsa/blob/master/src/ecdsa/test_keys.py#L1132-L1135

....-----BEGIN PRIVATE KEY-----
....MFMCAQEwBQYDK2VwBCIEICc2F2ag1n1QP0jY+g9qWx5sDkx0s/HdNi3cSRHw+zsI
....oSMDIQA+HQ2xCif8a/LMWR2m5HaCm5I2pKe/cc8OiRANMHxjKQ==
....-----END PRIVATE KEY-----

last line contain leading spaces and not skipped in old version unpem and in base64.b64decode(d)

d = b"MFM...KQ==-----END PRIVATE KEY-----"

Python 3.13.12 or 3.14.3 skip extra chars after padding, but after python/cpython#145264 (Python 3.13.13 or 3.14.4), this is not the case, now raise binascii.Error: Incorrect padding

@shadchin shadchin changed the title Fix tests with new Python Fix test test_SigningKey_from_pem_pkcs8v2_EdDSA with new Python Apr 9, 2026
@opoplawski
Copy link
Copy Markdown

We are seeing this now in Fedora: https://koschei.fedoraproject.org/package/python-ecdsa?collection=f44
This patch appears to fix it for us as well. Thanks.

fk29g added a commit to fk29g/nixpkgs that referenced this pull request May 23, 2026
Python update caused one of the tests to fail. A patch that fixes this
has been submitted upstream, yet to be applied. This commit adds the
patch.

See tlsfuzzer/python-ecdsa#371.
DrymarchonShaun pushed a commit to DrymarchonShaun/nixpkgs that referenced this pull request May 26, 2026
Python update caused one of the tests to fail. A patch that fixes this
has been submitted upstream, yet to be applied. This commit adds the
patch.

See tlsfuzzer/python-ecdsa#371.
@tomato42 tomato42 marked this pull request as draft June 5, 2026 10:37
@tomato42 tomato42 marked this pull request as ready for review June 5, 2026 10:37
@tomato42 tomato42 merged commit f8e0f3a into tlsfuzzer:master Jun 5, 2026
28 of 29 checks passed
@shadchin shadchin deleted the patch-1 branch June 5, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants